/**
 * @Project : ProgrammingExercises
 * @Package : Leetcode
 * @File : Q2545.java
 * @Author : WangRuoyu
 * @Date 2023/1/30 9:18
 */

package leetcode;

import java.util.Arrays;

public class Q2545 {
    public int[][] sortTheStudents(int[][] score, int k) {
        Arrays.sort(score, (a, b) -> b[k] - a[k]);
        return score;
    }

    public static void main(String[] args) {
        Q2545 sl = new Q2545();
        int[][] score = {{10, 6, 9, 1}, {7, 5, 11, 2}, {4, 8, 3, 15}};
        int k = 2;

        for (int[] s : score) {
            System.out.println(Arrays.toString(s));
        }

        for (int[] s : sl.sortTheStudents(score, k)) {
            System.out.println(Arrays.toString(s));
        }
    }
}
